Integrand size = 33, antiderivative size = 52 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {A x}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}-\frac {(A-B+C) \tan (c+d x)}{a d (1+\sec (c+d x))} \]
Leaf count is larger than twice the leaf count of optimal. \(163\) vs. \(2(52)=104\).
Time = 0.91 (sec) , antiderivative size = 163, normalized size of antiderivative = 3.13 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {4 \cos \left (\frac {1}{2} (c+d x)\right ) \left (C+B \cos (c+d x)+A \cos ^2(c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right ) \left (A d x-C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-(A-B+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )\right )}{a d (1+\cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 (c+d x)))} \]
(4*Cos[(c + d*x)/2]*(C + B*Cos[c + d*x] + A*Cos[c + d*x]^2)*(Cos[(c + d*x) /2]*(A*d*x - C*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + C*Log[Cos[(c + d *x)/2] + Sin[(c + d*x)/2]]) - (A - B + C)*Sec[c/2]*Sin[(d*x)/2]))/(a*d*(1 + Cos[c + d*x])*(A + 2*C + 2*B*Cos[c + d*x] + A*Cos[2*(c + d*x)]))
Time = 0.49 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.04, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {3042, 4538, 3042, 4257, 4407, 3042, 4281}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a \sec (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2}{a \csc \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 4538 |
\(\displaystyle \frac {\int \frac {a A+a (B-C) \sec (c+d x)}{\sec (c+d x) a+a}dx}{a}+\frac {C \int \sec (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a A+a (B-C) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{a}+\frac {C \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\int \frac {a A+a (B-C) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}\) |
\(\Big \downarrow \) 4407 |
\(\displaystyle \frac {A x-a (A-B+C) \int \frac {\sec (c+d x)}{\sec (c+d x) a+a}dx}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {A x-a (A-B+C) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}\) |
\(\Big \downarrow \) 4281 |
\(\displaystyle \frac {A x-\frac {a (A-B+C) \tan (c+d x)}{d (a \sec (c+d x)+a)}}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}\) |
(C*ArcTanh[Sin[c + d*x]])/(a*d) + (A*x - (a*(A - B + C)*Tan[c + d*x])/(d*( a + a*Sec[c + d*x])))/a
3.5.53.3.1 Defintions of rubi rules used
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[-Cot[e + f*x]/(f*(b + a*Csc[e + f*x])), x] /; FreeQ[{a, b, e, f} , x] && EqQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(b*c - a*d)/a Int[Csc[e + f* x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[C/b Int[Csc[ e + f*x], x], x] + Simp[1/b Int[(A*b + (b*B - a*C)*Csc[e + f*x])/(a + b*C sc[e + f*x]), x], x] /; FreeQ[{a, b, e, f, A, B, C}, x]
Time = 0.14 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.15
method | result | size |
parallelrisch | \(\frac {-C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-A +B -C \right )+d x A}{a d}\) | \(60\) |
derivativedivides | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 A \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) | \(86\) |
default | \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 A \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) | \(86\) |
risch | \(\frac {A x}{a}-\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{a d}\) | \(120\) |
norman | \(\frac {\frac {A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {\left (A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {A x}{a}-\frac {\left (A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}+\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}-\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a d}\) | \(131\) |
(-C*ln(tan(1/2*d*x+1/2*c)-1)+C*ln(tan(1/2*d*x+1/2*c)+1)+tan(1/2*d*x+1/2*c) *(-A+B-C)+d*x*A)/a/d
Time = 0.25 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.75 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {2 \, A d x \cos \left (d x + c\right ) + 2 \, A d x + {\left (C \cos \left (d x + c\right ) + C\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C \cos \left (d x + c\right ) + C\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (A - B + C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
1/2*(2*A*d*x*cos(d*x + c) + 2*A*d*x + (C*cos(d*x + c) + C)*log(sin(d*x + c ) + 1) - (C*cos(d*x + c) + C)*log(-sin(d*x + c) + 1) - 2*(A - B + C)*sin(d *x + c))/(a*d*cos(d*x + c) + a*d)
\[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {\int \frac {A}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(A/(sec(c + d*x) + 1), x) + Integral(B*sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*sec(c + d*x)**2/(sec(c + d*x) + 1), x))/a
Leaf count of result is larger than twice the leaf count of optimal. 146 vs. \(2 (52) = 104\).
Time = 0.31 (sec) , antiderivative size = 146, normalized size of antiderivative = 2.81 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {A {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + C {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + \frac {B \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \]
(A*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - sin(d*x + c)/(a*(cos(d*x + c) + 1))) + C*(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a - sin(d*x + c)/(a*(cos(d*x + c) + 1))) + B *sin(d*x + c)/(a*(cos(d*x + c) + 1)))/d
Time = 0.33 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.77 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {\frac {{\left (d x + c\right )} A}{a} + \frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a}}{d} \]
((d*x + c)*A/a + C*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - C*log(abs(tan(1/ 2*d*x + 1/2*c) - 1))/a - (A*tan(1/2*d*x + 1/2*c) - B*tan(1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a)/d
Time = 16.35 (sec) , antiderivative size = 113, normalized size of antiderivative = 2.17 \[ \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {2\,A\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+2\,C\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-B\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+C\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )} \]